package com.magold.game.level;

public enum RecordUpdateResult {
	NO_CHANGE(0), UPDATE_TIME(1), UPDATE_COIN(2), UPDATE_BOTH(3);
	
	private int mask;
	private RecordUpdateResult(int pMask) {
		mask = pMask;
	}

	public int getMask() {
		return mask;
	}
	
	public static RecordUpdateResult combine(RecordUpdateResult a, RecordUpdateResult b) {
		switch (a.getMask() | b.getMask()) {
		case 0: return NO_CHANGE;
		case 1: return UPDATE_TIME;
		case 2: return UPDATE_COIN;
		case 3: return UPDATE_BOTH;
		}
		return null;
	}
}